package cn.stacey.springmvc.convert;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.core.convert.converter.Converter;

public class DateConverter implements Converter<String,Date>{
private static final DateFormat FORMAT=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	@Override
	public Date convert(String source) {
		try {
			return FORMAT.parse(source);
		} catch (ParseException e) {
		
		}
		return null;	
	}

}
